import { showToast } from 'vant'
import APIS from '../api/api'
import http from '../api/request'

const goodsService = {
  getGoodsList(userInfo) {
    return userInfo.userAccount
      ? http.$axios({
          url: APIS.getGoodsCartList,
          method: 'POST',
          data: { userAccount: userInfo.userAccount },
          token: userInfo.token,
        })
      : []
  },
  stepChange({ goodsId, goodsNum }) {
    return http.$axios({
      url: APIS.updateCartGoodsNum,
      method: 'POST',
      data: { goodsId, goodsNum },
    })
  },
}

export default goodsService
